/**
 * 
 */
package com.couchcrowler.client.event;



import com.google.gwt.event.shared.GwtEvent;

/**
 * @author Vincentas
 *
 */
public class LoadingStatusEvent extends GwtEvent<LoadingStatusHandler> {

	@SuppressWarnings("rawtypes")
	private final Class loaderClass;
	
	private final int itemsLoaded;
	
	private final int itemsLeft;
	
	public LoadingStatusEvent(int itemsLoaded, int itemsLeft, @SuppressWarnings("rawtypes") Class laoderClass) {
		this.itemsLoaded = itemsLoaded;
		this.itemsLeft = itemsLeft;
		this.loaderClass = laoderClass;
	}
	
	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<LoadingStatusHandler> getAssociatedType() {
		return LoadingStatusHandler.type;
	}

	@Override
	protected void dispatch(LoadingStatusHandler handler) {
		handler.loadingStatusUpdate(itemsLoaded, itemsLeft, loaderClass);		
	}

}
